package com.xujie.sportsmeeting.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 公告发布请求DTO
 */
@Data
@Schema(description = "公告发布请求参数")
public class NoticePublishDTO {

    @Schema(description = "公告ID(更新时需要)")
    private Long id;

    @Schema(description = "公告标题", example = "关于举办校运会的通知")
    @NotBlank(message = "公告标题不能为空")
    private String title;

    @Schema(description = "公告内容", example = "各院系、各班级...")
    @NotBlank(message = "公告内容不能为空")
    private String content;

    @Schema(description = "公告类型", example = "2", allowableValues = {"1", "2", "3", "4"})
    @NotNull(message = "公告类型不能为空")
    private Integer noticeType;

    @Schema(description = "优先级", example = "2", allowableValues = {"1", "2", "3", "4"})
    private Integer priority;

    @Schema(description = "是否置顶", example = "0", allowableValues = {"0", "1"})
    private Integer isTop;

    @Schema(description = "有效期开始时间", example = "2024-05-01 00:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime validStartTime;

    @Schema(description = "有效期结束时间", example = "2024-05-31 23:59:59")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime validEndTime;

    @Schema(description = "目标用户类型", example = "0", allowableValues = {"0", "1", "2", "3"})
    private Integer targetUserType;

    @Schema(description = "是否需要确认阅读", example = "0", allowableValues = {"0", "1"})
    private Integer needConfirm;

    @Schema(description = "附件地址", example = "http://example.com/file.pdf")
    private String attachmentUrl;
}
